﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

using Qianwei.Model;
using Qianwei.Biz;
using Qianwei.Common.Extension;

namespace Qianwei.Web
{
    public partial class News : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SetContent();
            }
        }

        private void SetContent()
        {
            int nid = Request["nid"].TryInt();
            if (nid == 0)
            {
                lcontenttitle.Text = "未知标题";
                lcontent.Text = "未知内容";
                return;
            }
            IList<news_center> news = NewsCenterManager.Instance.QueryNewsCenter("New_Center_Id=" + nid);
            if (news == null || news.Count == 0)
            {
                lcontenttitle.Text = "未知标题";
                lcontent.Text = "未知内容";
                return;
            }
            news_center pagenew = news.First();
            lcontenttitle.Text = pagenew.New_Title;
            lcontent.Text = pagenew.New_Content;
        }
    }
}